package cn.hospital.util;

import java.util.List;

public class PageBean<T> {
private int currentPage;
private int totalPage;
private int pageSize;
private int totalCount = 0;
private int startIndex = 0;

private List<T> list;

public PageBean() {
	super();
}

public int getCurrentPage() {
	return currentPage;
}
public void setCurrentPage(int currentPage) {
	this.currentPage = currentPage;
}
public int getTotalPage() {
	return totalPage;
}
public void setTotalPage(int totalPage) {
	this.totalPage = totalPage;
}
public int getPageSize() {
	return pageSize;
}
public void setPageSize(int pageSize) {
	this.pageSize = pageSize;
}
public int getTotalCount() {
	return totalCount;
}

public void setTotalCount(int totalCount) {
	this.totalCount = totalCount;
	this.totalPage = (totalCount % pageSize) == 0 ? totalCount/pageSize: totalCount/pageSize + 1;
	if(totalCount == 0) {
		this.totalPage = 1;
	}
	this.startIndex = (this.currentPage - 1)*this.pageSize;
}
public int getStartIndex() {
	return startIndex;
}
public void setStartIndex(int pageIndex) {
	this.startIndex = pageIndex;
}
public List<T> getList() {
	return list;
}
public void setList(List<T> list) {
	this.list = list;
}


}
